<!DOCTYPE html>
<html lang=zh>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="1.申请Github第三方登录授权申请地址    字段 说明    Application name 应用名，可以随便填   Homepage URL 主页地址，填写博客首页即可。例如: https:&#x2F;&#x2F;fengzxia.gitee.io&#x2F;   Application description 应用说明，可以随便填   Authorization callback URL 回调地址，填首页即可htt">
<meta property="og:type" content="article">
<meta property="og:title" content="通过Gitalk免费给你的Hexo博客添加评论模块">
<meta property="og:url" content="https:&#x2F;&#x2F;fengzxia.gitee.io&#x2F;posts&#x2F;6aa8e662.html">
<meta property="og:site_name" content="只是学习学习的博客">
<meta property="og:description" content="1.申请Github第三方登录授权申请地址    字段 说明    Application name 应用名，可以随便填   Homepage URL 主页地址，填写博客首页即可。例如: https:&#x2F;&#x2F;fengzxia.gitee.io&#x2F;   Application description 应用说明，可以随便填   Authorization callback URL 回调地址，填首页即可htt">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQoLO1.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQTL9g.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQ7ZuR.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQLUyQ.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQODnH.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQOM1U.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQjFds.jpg">
<meta property="og:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQjiZj.jpg">
<meta property="article:published_time" content="2020-04-20T06:16:07.000Z">
<meta property="article:modified_time" content="2020-04-20T07:32:47.784Z">
<meta property="article:author" content="只是学习学习">
<meta property="article:tag" content="自建博客">
<meta property="article:tag" content="添加评论">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https:&#x2F;&#x2F;s1.ax1x.com&#x2F;2020&#x2F;04&#x2F;20&#x2F;JQoLO1.jpg">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/favicon-192x192.png" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
          
        
    
    <!-- title -->
    <title>通过Gitalk免费给你的Hexo博客添加评论模块</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
    
<meta name="generator" content="Hexo 4.1.1"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">主页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/categories/">分类</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/about/">关于</a></li>
         
          <li><a href="/friend_ship/">友链</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/posts/4bc1a9dd.html"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/posts/812771cf.html"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">上一篇</span>
      <span id="i-next" class="info" style="display:none;">下一篇</span>
      <span id="i-top" class="info" style="display:none;">返回顶部</span>
      <span id="i-share" class="info" style="display:none;">分享文章</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=https://fengzxia.gitee.io/posts/6aa8e662.html" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=https://fengzxia.gitee.io/posts/6aa8e662.html&text=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=https://fengzxia.gitee.io/posts/6aa8e662.html&is_video=false&description=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=通过Gitalk免费给你的Hexo博客添加评论模块&body=Check out this article: https://fengzxia.gitee.io/posts/6aa8e662.html"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=https://fengzxia.gitee.io/posts/6aa8e662.html&name=通过Gitalk免费给你的Hexo博客添加评论模块&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=https://fengzxia.gitee.io/posts/6aa8e662.html&t=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-申请Github第三方登录授权"><span class="toc-number">1.</span> <span class="toc-text">1.申请Github第三方登录授权</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-安装Gitalk插件"><span class="toc-number">2.</span> <span class="toc-text">2.安装Gitalk插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#安装"><span class="toc-number">2.1.</span> <span class="toc-text">安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#用法"><span class="toc-number">2.2.</span> <span class="toc-text">用法</span></a></li></ol></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        通过Gitalk免费给你的Hexo博客添加评论模块
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">只是学习学习的博客</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2020-04-20T06:16:07.000Z" itemprop="datePublished">2020-04-20</time>
        
      
    </div>


      
    <div class="article-category">
        <i class="fas fa-archive"></i>
        <a class="category-link" href="/categories/Hexo/">Hexo</a>
    </div>


      
    <div class="article-tag">
        <i class="fas fa-tag"></i>
        <a class="tag-link" href="/tags/%E6%B7%BB%E5%8A%A0%E8%AF%84%E8%AE%BA/" rel="tag">添加评论</a>, <a class="tag-link" href="/tags/%E8%87%AA%E5%BB%BA%E5%8D%9A%E5%AE%A2/" rel="tag">自建博客</a>
    </div>


    </div>
  </header>
  

  <div class="content"itemprop ="articleBody">
    <h2 id="1-申请Github第三方登录授权"><a href="#1-申请Github第三方登录授权" class="headerlink" title="1.申请Github第三方登录授权"></a>1.申请Github第三方登录授权</h2><p><a href="https://github.com/settings/applications/new" target="_blank" rel="noopener">申请地址</a><br><img src="https://s1.ax1x.com/2020/04/20/JQoLO1.jpg" alt="JQoLO1.jpg"></p>
<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="left">说明</th>
</tr>
</thead>
<tbody><tr>
<td align="center"><code>Application name</code></td>
<td align="left">应用名，可以随便填</td>
</tr>
<tr>
<td align="center"><code>Homepage URL</code></td>
<td align="left">主页地址，填写博客首页即可。例如: <code>https://fengzxia.gitee.io/</code></td>
</tr>
<tr>
<td align="center"><code>Application description</code></td>
<td align="left">应用说明，可以随便填</td>
</tr>
<tr>
<td align="center"><code>Authorization callback URL</code></td>
<td align="left">回调地址，填首页即可<code>https://fengzxia.gitee.io/</code></td>
</tr>
</tbody></table>
<p>申请成功后会生成<code>Client ID</code>和<code>Client Secret</code>保存稍后备用<br><img src="https://s1.ax1x.com/2020/04/20/JQTL9g.jpg" alt="JQTL9g.jpg"></p>
<p>也可在<code>Settings-&gt;Developer settings-&gt;OAuth Apps</code>下找到我们刚才申请的应用<br><img src="https://s1.ax1x.com/2020/04/20/JQ7ZuR.jpg" alt="JQ7ZuR.jpg"></p>
<h2 id="2-安装Gitalk插件"><a href="#2-安装Gitalk插件" class="headerlink" title="2.安装Gitalk插件"></a>2.安装Gitalk插件</h2><ul>
<li><a href="https://github.com/snowdreams1006/hexo-plugin-gitalk" target="_blank" rel="noopener">hexo-plugin-gitalk</a>: Hexo 整合 gitalk 组件实现博客评论功能<h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-plugin-gitalk --save</span><br></pre></td></tr></table></figure>


</li>
</ul>
<h3 id="用法"><a href="#用法" class="headerlink" title="用法"></a>用法</h3><ol>
<li><p>在根目录下的<code>_config.yml</code>，添加如下配置</p>
 <figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">plugins:</span></span><br><span class="line">  <span class="attr">gitalk:</span></span><br><span class="line">    <span class="attr">clientID:</span> <span class="string">xxx</span></span><br><span class="line">    <span class="attr">clientSecret:</span> <span class="string">xxxxxx</span></span><br><span class="line">    <span class="attr">repo:</span> <span class="string">blog_comment</span></span><br><span class="line">    <span class="attr">owner:</span> <span class="string">FENG1000</span></span><br><span class="line">    <span class="attr">admin:</span> </span><br><span class="line">      <span class="bullet">-</span> <span class="string">FENG1000</span></span><br><span class="line">    <span class="attr">distractionFreeMode:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure>

<ul>
<li><p><code>clientID</code>: 刚才保存的<code>clientID</code></p>
</li>
<li><p><code>clientSecret</code>: 刚才保存的<code>clientSecret</code></p>
</li>
<li><p><code>repo</code>: 仓库名(可以自己随意填写)。需要再创建一个专门存放评论的仓库，只需要写仓库名即可</p>
</li>
<li><p><code>owner</code>: 所有者。填自己的用户名即可</p>
</li>
<li><p><code>admin</code>: 管理员。填用户名即可，如果还有其他用户为管理员也可添加他的用户名</p>
</li>
<li><p><code>distractionFreeMode</code>: 是否开启。类似Facebook评论框的全屏遮罩效果.</p>
</li>
<li><p><em>注: <code>repo</code>创建的仓库必须是<code>Public</code>，并且该仓库要开始<code>issue</code>。还要在<code>issue</code>中创建一个<code>Gitalk</code>的标签(<code>label</code>)进行初始化。否则会报<code>Error Note Found.</code>错误*</em><br><img src="https://s1.ax1x.com/2020/04/20/JQLUyQ.jpg" alt="JQLUyQ.jpg"></p>
<p>添加标签</p>
</li>
</ul>
<ol>
<li><img src="https://s1.ax1x.com/2020/04/20/JQODnH.jpg" alt="JQODnH.jpg"></li>
</ol>
<hr>
<ol start="2">
<li><img src="https://s1.ax1x.com/2020/04/20/JQOM1U.jpg" alt="JQOM1U.jpg"></li>
</ol>
</li>
<li><p>重新<code>hexo clean</code>，<code>hexo generate</code>重新生成页面。<code>hexo server</code>本地启动即可看到效果：<br> <img src="https://s1.ax1x.com/2020/04/20/JQjFds.jpg" alt="JQjFds.jpg"><br> 之所以看到此页面是因为他需要<strong>管理员</strong>先登录一次，因为在管理员登录后会自动在评论仓库<code>blog_comment</code>的<code>issue</code>中初始化该篇文章的评论信息。管理员登录访问过后效果：<br> <img src="https://s1.ax1x.com/2020/04/20/JQjiZj.jpg" alt="JQjiZj.jpg"></p>
</li>
</ol>
<p>这样基于Gitalk的评论模块就配置成功了，有些主题可能没有适配Gitalk，样式可能会不太好看</p>

<div id="gitalk-container"></div>
<script src="https://cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script><link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css"><script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>

		<script>
		var gitalkConfig = {"clientID":"28a065e3b5afee156f4f","clientSecret":"e18104d6f3219526491fc42c892ff6a26b8f3e74","repo":"blog_comment","owner":"FENG1000","admin":["FENG1000"],"distractionFreeMode":false};
	    gitalkConfig.id = md5(location.pathname);
		var gitalk = new Gitalk(gitalkConfig);
	    gitalk.render("gitalk-container");
	    </script>
    
  </div>
</article>




        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">主页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/categories/">分类</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/about/">关于</a></li>
         
          <li><a href="/friend_ship/">友链</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-申请Github第三方登录授权"><span class="toc-number">1.</span> <span class="toc-text">1.申请Github第三方登录授权</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-安装Gitalk插件"><span class="toc-number">2.</span> <span class="toc-text">2.安装Gitalk插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#安装"><span class="toc-number">2.1.</span> <span class="toc-text">安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#用法"><span class="toc-number">2.2.</span> <span class="toc-text">用法</span></a></li></ol></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=https://fengzxia.gitee.io/posts/6aa8e662.html" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=https://fengzxia.gitee.io/posts/6aa8e662.html&text=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=https://fengzxia.gitee.io/posts/6aa8e662.html&is_video=false&description=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=通过Gitalk免费给你的Hexo博客添加评论模块&body=Check out this article: https://fengzxia.gitee.io/posts/6aa8e662.html"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=https://fengzxia.gitee.io/posts/6aa8e662.html&title=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=https://fengzxia.gitee.io/posts/6aa8e662.html&name=通过Gitalk免费给你的Hexo博客添加评论模块&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=https://fengzxia.gitee.io/posts/6aa8e662.html&t=通过Gitalk免费给你的Hexo博客添加评论模块" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> 菜单</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> 目录</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> 分享</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> 返回顶部</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy;
    
    
    2019-2020
    只是学习学习
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">主页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/categories/">分类</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/about/">关于</a></li>
         
          <li><a href="/friend_ship/">友链</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"复制到粘贴板!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "复制成功!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

    <script type="text/javascript">
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?54382acbd8c4bc66535bce135e0ac166";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>

<!-- Disqus Comments -->


</body>
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https'){
   bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
  bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
</html>
